<template>
  <div></div>
</template>

<script setup lang="ts">
import { watch } from "vue";

const props = defineProps({
  user: {
    type: Object,
    required: true,
  },
  num: {
    type: Number,
    required: true,
  },
});
console.log("props", props);
watch(
  props.user,
  (newVal, oldVal) => {
    console.log("props.user变化了", newVal, oldVal);
  },
  {
    deep: true,
  }
);

watch(
  () => props.num,
  (newVal, oldVal) => {
    console.log("props.num变化了", newVal, oldVal);
  }
);
</script>

<style scoped></style>
